export {}

type MyFunction = (str: string) => void

// 直接使用函数类型来限制变量
let fn: MyFunction = (a) => "hello"

// 用来限制回调函数的结构
function eventHandler(event: string, callback: MyFunction) {}


eventHandler("hello", (a:string) => {})